﻿using UnityEngine;
using System.Collections;

public class ShowRandom : MonoBehaviour {

    public bool isWarming = false;
    public string text;
    float time = 0f;
    public string label;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        if (isWarming)
            ShowWarming();
        else 
        {
            time += Time.deltaTime;
            if (time >= 2f)
            {
                Show();
                time = 0f;
            }

        }
	
	}

    private void Show()
    {
        GetComponent<TextMesh>().text = Random.Range(15, 29).ToString() + label ;
        
    }
    public void ShowWarming()
    {
        GetComponent<TextMesh>().text = text+label;
    }
}
